Skip to content

Send view focus events and handle focus change requests - #188

Draft
JSUYA wants to merge 1 commit into
flutter-tizen:masterfrom
JSUYA:view_focus_event
Draft

Send view focus events and handle focus change requests#188
JSUYA wants to merge 1 commit into
flutter-tizen:masterfrom
JSUYA:view_focus_event

Conversation

@JSUYA

@JSUYA JSUYA commented Jul 24, 2026

Copy link
Copy Markdown
Member

@JSUYA JSUYA self-assigned this Jul 24, 2026
@JSUYA
JSUYA marked this pull request as draft July 24, 2026 09:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d4745091e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

flutter::FlutterTizenEngine* tizen_engine = EngineFromHandle(engine);
tizen_engine->lifecycle_channel()->AppIsResumed();
if (tizen_engine->view()) {
tizen_engine->view()->OnFocus(kFocused);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve focus-skip windows as unfocused

When FlutterDesktopWindowProperties.focusable is false, TizenWindowEcoreWl2::SetWindowOptions marks the native window with ecore_wl2_window_focus_skip_set(..., EINA_TRUE), so the app can resume while this view is intentionally unable to receive platform focus. This unconditional kFocused event makes PlatformDispatcher.onViewFocusChange report focus for those overlay/background windows even though native key focus remains elsewhere; gate this on the window's actual/focusable state rather than app resume alone.

Useful? React with 👍 / 👎.

@JSUYA
JSUYA force-pushed the view_focus_event branch from 4d47450 to 163b2ed Compare July 30, 2026 09:24
The engine's view-focus embedder API (FlutterEngineSendViewFocusEvent,
view_focus_change_request_callback) is declared in embedder.h but was
never wired up, so PlatformDispatcher.onViewFocusChange and
requestViewFocusChange did not work on Tizen.

Since the embedder has no native window focus event handler, the app
lifecycle is used as a proxy for view focus: kFocused is sent to the
engine when the app is resumed, and kUnfocused when it becomes
inactive or paused. Focus change requests from the framework are
handled by activating the window. Windows created with
focusable = false are marked with ecore_wl2_window_focus_skip_set and
can never receive native key focus, so kFocused events and window
activation are skipped for them.

Fixes flutter-tizen#187
@JSUYA
JSUYA force-pushed the view_focus_event branch from 163b2ed to 6eb7827 Compare July 31, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant